<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width= , initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="container">
    <p id="text">当前数值为：100</p>
    <button id="btn1">点击增大</button>
    <button id="btn2">点击减小</button>
  </div>
  
  <script>
    var text = document.querySelector('#text');
    var btn1 = document.querySelector('#btn1');
    var btn2 = document.querySelector('#btn2');

    var num = 100;

    btn1.onclick = function () {
      num++;
      text.innerText = '当前数值为：' + num;
    };

    btn2.onclick = function () {
      num--;
      text.innerText = '当前数值为：' + num;
    };
  </script>
</body>
</html>